package com.pi.entity;

import com.pi.utils.GetTimeUtil;
import lombok.Data;
import org.springframework.stereotype.Component;

import java.util.Calendar;
import java.util.Date;

/**
 * @author 墨染半世凉
 * @version 1.0
 * @date 2023/10/18
 */

public class SignIn {
    private Integer year;
    private Integer month;
    private Integer day;
    private String studentId;
    private Date time;
    private String isSignIn;


    public Integer getYear() {
        return year;
    }

    public void setYear() {
        this.year = year;
    }

    public Integer getMonth() {
        return month;
    }

    public void setMonth(Integer month) {
        this.month = month;
    }

    public Integer getDay() {
        return day;
    }

    public void setDay(Integer day) {
        this.day = day;
    }

    public String getStudentId() {
        return studentId;
    }

    public void setStudentId(String studentId) {
        this.studentId = studentId;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public String getIsSignIn() {
        return isSignIn;
    }

    public void setIsSignIn(String isSignIn) {
        this.isSignIn = isSignIn;
    }

    public SignIn() {
        this.year = GetTimeUtil.getCalendar().get(Calendar.YEAR);
        this.month = GetTimeUtil.getCalendar().get(Calendar.MONTH) + 1;
        this.day = GetTimeUtil.getCalendar().get(Calendar.DATE);
    }

    public SignIn(Integer year, Integer month, Integer day, String studentId, Date time, String isSignIn) {
        this.year = year;
        this.month = month;
        this.day = day;
        this.studentId = studentId;
        this.time = time;
        this.isSignIn = isSignIn;
    }

    @Override
    public String toString() {
        return "SignIn{" +
                "year=" + year +
                ", month=" + month +
                ", day=" + day +
                ", studentId='" + studentId + '\'' +
                ", time=" + time +
                ", isSignIn='" + isSignIn + '\'' +
                '}';
    }
}
